<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>浮动实现</title>
    <style>
        body, html {
            margin: 0;
            padding: 0;
            height: 100%;
        }

        .header, .footer {
            height: 40px;
            background-color: red;
        }

        .footer {
            clear: both;
        }

        .container {
            height: calc(100% - 80px);
            padding-left: 200px;
            padding-right: 300px;
        }

        .container div {
            float: left;
            position: relative;
        }

        .middle {
            background-color: #09a5c4;
            width: 100%;
            height: 100%;
        }

        .left {
            width: 200px;
            height: 100%;
            background-color: darkorchid;
            margin-left: -100%;
            right: 200px;
        }

        .right {
            height: 100%;
            width: 300px;
            background-color: blue;
            margin-right: -300px;
        }


    </style>
</head>
<body>
<div class="header">这里是头部</div>
<div class="container">
    <div class="middle">中间部分</div>
    <div class="left">左边</div>
    <div class="right">右边</div>
</div>
<div class="footer">这里是底部</div>
</body>
</html>
